﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CoffeePotServer
{
    /// <summary>
    /// File: Addition.cs
    /// Author: James Dibble 10009689
    /// Last Revision: 17/03/12
    /// SVN Address:
    /// http://code.google.com/p/cnos-coffeepot-server/source/browse/branches/DibbleBranch/CoffeePotServerLib/CoffeePotServerLib/Addition.cs
    /// </summary>
    public class Addition
    {
        #region Attributes
        private AdditionType _type;
        #endregion

        #region Constructor
        /// <summary>
        /// Create an addition.
        /// </summary>
        /// <param name="addition">The description of the addition.</param>
        public Addition(String addition)
        {
            switch (addition.ToLower())
            {
                case "cream":
                    _type = AdditionType.CREAM;
                    break;
                case "half-and-half":
                    _type = AdditionType.HALF_AND_HALF;
                    break;
                case "whole-milk":
                    _type = AdditionType.WHOLE_MILK;
                    break;
                case "skim":
                    _type = AdditionType.SKIM;
                    break;
                case "part-skim":
                    _type = AdditionType.PART_SKIM;
                    break;
                case "non-dairy":
                    _type = AdditionType.NON_DAIRY;
                    break;
                case "vanilla":
                    _type = AdditionType.VANILLA;
                    break;
                case "almond":
                    _type = AdditionType.ALMOND;
                    break;
                case "raspberry":
                    _type = AdditionType.RASPBERRY;
                    break;
                case "chocolate":
                    _type = AdditionType.CHOCOLATE;
                    break;
                case "whiskey":
                    _type = AdditionType.WHISKEY;
                    break;
                case "rum":
                    _type = AdditionType.RUM;
                    break;
                case "kahlua":
                    _type = AdditionType.KAHLUA;
                    break;
                case "aquavit":
                    _type = AdditionType.AQUAVIT;
                    break;
                case "*":
                    _type = AdditionType.NONE;
                    break;
                default:
                    throw new ClientResponseException("Unsupported Addition Requested.", ClientResponseException.ExceptionType.INVALIDADDITION);
            }
        }
        #endregion

        #region Properties
        public AdditionType Type
        {
            get { return _type; }
        }
        #endregion

        #region Enums
        public enum AdditionType
        {
            CREAM,
            HALF_AND_HALF,
            WHOLE_MILK,
            SKIM,
            PART_SKIM,
            NON_DAIRY,
            VANILLA,
            ALMOND,
            RASPBERRY,
            CHOCOLATE,
            WHISKEY,
            RUM,
            KAHLUA,
            AQUAVIT,
            NONE
        }

        /// <summary>
        /// NOT IMPLEMENTED
        /// </summary>
        public enum Quantity
        {

        }
        #endregion
    }
}